<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<style>
.radio-inline{
padding: 0;
}
.col-md-8 .radio-list .tuning{
margin-left: 38px;
}
.tuning-width{
width: 88px;
}
.wraping{
background: #fff;		
}
/*.page-sidebar-menu{
	height: 670px;
}*/
	.modal-content .modal-footer button.btn-primary {
		margin-top:0; 
		margin-bottom: 0;
	}
		.btn-div{
		float: left;top: 10px;margin-bottom: 5px;padding-left: 10px;
	}
			.row{
			margin: 0;
		}
</style>
<body class="page-header-fixed">

<div class="btn-div">

<a class="btn blue" href="javascript:;"  ng-click="syncMerchant();">
<i class="fa fa-plus"></i>
	同步商户
</a>
</div>
<table class="table table-striped table-bordered table-hover" id="table_1">
<thead>
<tr>
<th>名称</th>
<th>归属类型</th>
<th>归属实体</th>
<th>地址</th>
<th>审核状态</th>
<th>是否使用</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX" ng-repeat="merchant in allMerchantList  track by $index" pg-loaded="{{$last}}" target-table="table_1">
<td>
	<span ng-bind="merchant.name | commonSubString" ></span>
</td>
<td>
	<span ng-bind="merchant.entity_type | getValueInStaticFilter : 'merchantEntityTypeArray'"></span>
</td>
<td>
	<span ng-bind="merchant.entity_name | commonSubString"></span>
</td>
<td>
	<span ng-bind="merchant.address | commonSubString"></span>
</td>
<td>
	<span ng-bind="merchant.review_state  | getValueInStaticFilter : 'reviewStateArray'"></span>
</td>
<td>
	<span ng-bind="merchant.valid_flag  | getValueInStaticFilter : 'validArray'"></span>
</td>
<td>
	<a class="btn" href="javascript:;"  data-target="#merchantModel" 
	data-toggle="modal" ng-click="updateMerchant(merchant);">
		修改
	</a>
</td>
</tr>
</tbody>
</table>
<tm-pagination conf="paginationConf"></tm-pagination>
<div id="merchantModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
<div class="modal-dialog">
<div class="modal-content">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">商户修改</h4>
	</div>
	<form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate 
	name="validateForm">
	<div class="modal-body form">
			<div class="form-group">
				<div class="row">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>商户名称</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input type="text" class="form-control" ng-model="selectedMerchant.name" 
							name="name" placeholder="请输入字母、数字、中文组合"  required="" ng-maxlength="50" ng-pattern="/^[\u4e00-\u9fa5\w]*$/"/>
						</div>
					</div>
				</div>
				<div class="row">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>商户地址</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input type="text" class="form-control" ng-model="selectedMerchant.address" name="address" placeholder="请输入商户地址" required="" ng-maxlength="100" />
						</div>
					</div>
				</div>
				<div class="row">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>城市代码</label>
					<div class="col-sm-8">
						<div class="input-group">
							<district-select  required='true'
	                        area-list="areaList" 
	                        city-list="cityList"
	                        district-list="districtList"
	                        selected-area="selectedArea" 
	                        selected-city="selectedCity" 
	                        selected-district="selectedDistrict"
	                        has-init-value="hasInitValue" >
	                        </district-select>
						</div>
					</div>
				</div>
				<div class="row">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>归属类型</label>
					<div class="col-md-8 paddingTop">
						<div class="radio-list">
							<label class="radio-inline">
								<input ng-model="selectedMerchant.entity_type" type="radio"  value="0" 
								ng-selected="selectedMerchant.entity_type==0">
									独立存在
							</label>
							<label class="radio-inline">
								<input ng-model="selectedMerchant.entity_type" type="radio"  value="1" 
								ng-selected="selectedMerchant.entity_type==1">
									运营商
							</label>
							<label class="radio-inline">
								<input ng-model="selectedMerchant.entity_type" type="radio"  value="2" 
								ng-selected="selectedMerchant.entity_type==2">
									运营商分支机构
							</label>

						</div>
					</div>
				</div>
				<div class="row">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>归属对象</label>
					<div class="col-sm-8">
						<div class="input-group">
							<select class="form-control" ng-if="!!selectedMerchant.entity_type&&selectedMerchant.entity_type==1"
							ng-options="operMechant.oper_merchant_id as operMechant.oper_name for operMechant in operMechantList " 
							ng-model="selectedMerchant.entity_id"  id="selectEntity">
							<option value="">请选择运营商</option>
							</select>
							<select class="form-control" ng-if="!!selectedMerchant.entity_type&&selectedMerchant.entity_type==2"
							ng-options="operMerchantBranch.oper_merchant_branch_id as operMerchantBranch.oper_name for operMerchantBranch in operMerchantBranchList " 
							ng-model="selectedMerchant.entity_id" id="selectEntity">
							<option value="">请选择运营商分支机构</option>
							</select>
							<select class="form-control" ng-if="!!selectedMerchant.entity_type&&selectedMerchant.entity_type==3"
							ng-options="factory.factory_id as factory.factory_name for factory in factoryList " 
							ng-model="selectedMerchant.entity_id" id="selectEntity">
							<option value="">请选择厂商</option>
							</select>
						</div>
					</div>
				</div>


<!-- 				<div class="row" ng-if="'insert'!=modifyType">
					<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否启用</label>
					<div class="col-md-8">
						<div class="radio-list">
							<label  class="radio-inline col-md-4 tuning-width" style="margin:0px;padding: 0px">
								<input ng-model="selectedMerchant.valid_flag" type="radio"  value="1" 
								ng-selected="selectedMerchant.valid_flag==1">
									启用
							</label>
							<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
								<input ng-model="selectedMerchant.valid_flag" type="radio"  value="0" 
								ng-selected="selectedMerchant.valid_flag==0">
									停用
							</label>
						</div>
					</div>
				</div> -->
			</div>
	</div>
	<div class="modal-footer">
		<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
		<button type="button" class="btn btn-primary" w5c-form-submit="modifyMerchant();"><i class="fa fa-check"></i>保存</button>
	</div>
	</form>
</div>
</div>
</div>
</body>
</html>
